<template>
	<view class="calendar-single">
		<mars-calendar
			:show="show"
			@confirm="dateConfirm"
			@close="show=false"
			:color="$s.theme"
			mode="single"
		></mars-calendar>
	</view>
</template>
<script>
	import { mapState } from 'vuex'
	export default {
		name: 'calendar-single',
		props: {
			start:{
				type:[Object,Array],
				default:{}
			},
			end:{
				type:[Object,Array],
				default:{}
			},
			//是否自动设置Vuex的值
			setvuex:{
				type:[Boolean],
				default:true
			}
		},
		data() {
			return {
				show:false,
			}
		},
		watch: {
		},
		computed:{
			...mapState({
				$s:state => state.$style,
				sys:state => state.$sys,
			})
		},
		mounted(){
		},
		methods: {
			//确认日期
			dateConfirm(e){
				this.show=false;
				this.$emit('dateConfirm',e)
			},
			//打开日历控件
			dateOpen(){
				this.show=true
			},
			//关闭日期弹窗
			dateClose(){
				this.show=false
			},
		}
	};
</script>
<style lang="scss">
</style>
